package com.acme.team02.chat.server;

import java.io.IOException;
import java.util.logging.FileHandler;
import java.util.logging.Logger;

import com.acme.team02.chat.server.connection.ConnectionManager;




public class ChatServer {
	static final int PORT = 2013;
	
	public static Logger logger;
	
	public static void main(String[] args) {
		logger = Logger.getLogger("serverLogger");
		try {
			logger.addHandler(new FileHandler("serverLog.txt", true));
		} catch (SecurityException | IOException e) {
			e.printStackTrace();
		}
		
		UserManager userManager = new UserManager();
		DatabaseConnectivity databaseConnectivity = new DatabaseConnectivity();
		MessageManager messageManager = new MessageManager(userManager, databaseConnectivity);
		
		ConnectionManager connMng = new ConnectionManager(PORT, userManager, messageManager);
		
		connMng.startServer();
	}

}
